package priv.yiyuan.example.design.pay;

/**
 * 支付抽象
 * <p>
 * 桥接模式的抽象部分
 */
public abstract class Payment {

    /**
     * 接口部分的引用
     */
    protected PaymentProcessor paymentProcessor;

    protected Payment(PaymentProcessor paymentProcessor) {
        this.paymentProcessor = paymentProcessor;
    }

    public abstract boolean makePayment(double amount);

    public abstract boolean requestRefund(double amount);

    public String getTransactionId() {
        return "TXN_" + System.currentTimeMillis();
    }
}
